package com.mezo.athena.system.service.impl;

import java.util.List;
import com.mezo.athena.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mezo.athena.system.mapper.RyDeviceMapper;
import com.mezo.athena.system.domain.RyDevice;
import com.mezo.athena.system.service.IRyDeviceService;

/**
 * 设备Service业务层处理
 * 
 * @author athena
 * @date 2024-11-13
 */
@Service
public class RyDeviceServiceImpl implements IRyDeviceService 
{
    @Autowired
    private RyDeviceMapper ryDeviceMapper;

    /**
     * 查询设备
     * 
     * @param id 设备主键
     * @return 设备
     */
    @Override
    public RyDevice selectRyDeviceById(Long id)
    {
        return ryDeviceMapper.selectRyDeviceById(id);
    }

    /**
     * 查询设备列表
     * 
     * @param ryDevice 设备
     * @return 设备
     */
    @Override
    public List<RyDevice> selectRyDeviceList(RyDevice ryDevice)
    {
        return ryDeviceMapper.selectRyDeviceList(ryDevice);
    }

    /**
     * 新增设备
     * 
     * @param ryDevice 设备
     * @return 结果
     */
    @Override
    public int insertRyDevice(RyDevice ryDevice)
    {
        ryDevice.setCreateTime(DateUtils.getNowDate());
        return ryDeviceMapper.insertRyDevice(ryDevice);
    }

    /**
     * 修改设备
     * 
     * @param ryDevice 设备
     * @return 结果
     */
    @Override
    public int updateRyDevice(RyDevice ryDevice)
    {
        ryDevice.setUpdateTime(DateUtils.getNowDate());
        return ryDeviceMapper.updateRyDevice(ryDevice);
    }

    /**
     * 批量删除设备
     * 
     * @param ids 需要删除的设备主键
     * @return 结果
     */
    @Override
    public int deleteRyDeviceByIds(Long[] ids)
    {
        return ryDeviceMapper.deleteRyDeviceByIds(ids);
    }

    /**
     * 删除设备信息
     * 
     * @param id 设备主键
     * @return 结果
     */
    @Override
    public int deleteRyDeviceById(Long id)
    {
        return ryDeviceMapper.deleteRyDeviceById(id);
    }
}
